package com.chengqj.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @program: pattern
 * @description: a
 * @author: chengqj
 * @create: 2018-08-08 18:54
 **/
public class DyProxy implements InvocationHandler {
    private Object target;

    public DyProxy(Object object) {
        this.target = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("前期物色");
        Object proxyObj = method.invoke(target, args);
        System.out.println("后续跟踪");
        return proxyObj;
    }
}
